<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.chanyachting.emall.serviceImpl.*"%>
<%@ page import="com.chanyachting.emall.service.*"%>
<%@ page import="com.chanyachting.emall.dao.*"%>
<%@ page import="com.chanyachting.emall.domain.*"%>

<%
   String rootPathInclude2yellowPage = request.getContextPath();

	YellowPageService yellowService = new YellowPageServiceImpl();
	
	List<Yellowpagecategory> ypcglist = yellowService.getAllYellowpagecategory();
	
	Yellowpagecategory ypcg = null;
	String bcname=null;
	Integer bcId=null;
	if (null != ypcglist && ypcglist.size() > 0) {
		for (int j = 0; j < ypcglist.size(); j++) {
			ypcg = ypcglist.get(j);
			bcId = ypcg.getId();
			bcname = ypcg.getName();
			
%>
      <li><a onclick="changemenu('menu_<%=bcId%>');" title="<%=bcname%>"><span><%=bcname%></span></a>
      	<div  id="menu_<%=bcId%>" style="DISPLAY: none">
      	<dl>
      		
<%			
			Yellowpagesubcategory ypsub = null;
			List<Yellowpagesubcategory> ypSublist = yellowService.getYellowpagesubcategory(bcId.toString());
			if (ypSublist != null && ypSublist.size() > 0) {
				for (int i = 0; i < ypSublist.size(); i++) {
					ypsub = ypSublist.get(i);
					Integer productcategoryId = ypsub.getId();
					String name = ypsub.getName();
%>
          <dd><a href="<%=rootPathInclude2yellowPage%>/frontend/yellow/yellowPages.do?productcategoryId=<%=productcategoryId%>" title="<%=name%>"><%=name%></a></dd>
<%					
					
        }
      }
%>
          </dl>
        </div>
      </li> 
<%
         
    }
  }
%>
